<?php

namespace app\admin\controller;

use app\common\controller\Backend;

/**
 * 板块管理
 *
 * @icon fa fa-circle-o
 */
class Bankuai extends Backend
{

    /**
     * Bankuai模型对象
     * @var \app\admin\model\Bankuai
     */
    protected $model = null;

    public function _initialize()
    {
        parent::_initialize();
        $this->model = new \app\admin\model\Bankuai;

    }

	public function shebei($ids = null)
	{
		if ($this->request->isPost()) {
            $this->token();
			
			$params = $this->request->post("row/a");
			$params['shebei'] = implode(',', $params['shebei']);
			$this->request->post(array('row'=>$params));
        }
        $row = $this->model->get($ids);
        if (!$row) {
            $this->error(__('No Results were found'));
        }
		$shebei = explode(',', $row['shebei']);
        $sbList = \app\admin\model\Equipment::column('id,device_serial,device_name,device_type,device_version');
		$this->assign("sbList", $sbList);
		$this->assign("shebei", $shebei);
		return parent::edit($ids);
	}
}
